import request from '@/utils/request'

// 获取组织架构所有部门数据
export const getDepartments = function() {
  return request({
    url: '/company/department'
  })
}

// 通过 id 删除部门
export const delDepartmentsById = function(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 新增部门
export const addDepartments = function(data) {
  return request({
    url: '/company/department/',
    method: 'post',
    data
  })
}

// 通过id获取部门详情
export const getDeptsDetailById = function(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 通过id修改部门详情
export const editDeptsDetail = function(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

